package com.panda.web.commons.enums;

public enum WeChat {
    PROJECT_EXPERIENCEA("1段", 1),
    PROJECT_EXPERIENCEB("2段及以上", 2),
     ZHENGSHU("1个",1),
    ZHENGSHUB("2个及以上",2),
    WORK_EXPERIENCE("没有", 1),
    SKILLS("技能", 4);

    private final String description; // 描述
    private final int value; // 对应的值

    // 枚举构造函数
    WeChat(String description, int value) {
        this.description = description;
        this.value = value;
    }

    // 根据描述获取对应的值
    public static int getValueByDescription(String description) {
        for (WeChat weChat : WeChat.values()) {
            if (weChat.description.equals(description)) {
                return weChat.value;
            }
        }
        throw new IllegalArgumentException("未知的描述: " + description);
    }

    // 根据值获取对应的描述
    public static String getDescriptionByValue(int value) {
        for (WeChat weChat : WeChat.values()) {
            if (weChat.value == value) {
                return weChat.description;
            }
        }
        throw new IllegalArgumentException("未知的值: " + value);
    }
}
